<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<link rel="stylesheet" href="${ctx}/ui/static/common/layer/1.9.3/skin/layer.css"/>
<script type="text/javascript" src="${ctx}/ui/static/common/layer/1.9.3/layer.js" charset="utf-8"></script>
<script type="text/javascript">

    $('#numbercombo').combobox({
        url:'${ctx}/file/getCombox?id=402880f9626fa24e01626fb1dbac0000',
        valueField:'value',
        textField:'text',
        editable:true,
        height:30
    });
    $('#levelscombo').combobox({
        url:'${ctx}/file/getCombox?id=402880f9626fbd0f01626fc0abc30001',
        valueField:'value',
        textField:'text',
        editable:true,
        height:30
    });
	var editor;
	$(function(){
		$('#title').focus();
		window.setTimeout(function() {
			editor = KindEditor.create('#content', {
				width : '1310px',
				height : '450px',
				items : [ 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', 'anchor', 'link', 'unlink' ],
				uploadJson : 'FileUpload.acc',
				fileManagerJson : 'fileController/fileManage.acc',
				allowFileManager : true
			});
			parent.$.messager.progress('close');
		}, 1);

	})

		$('#fileadd_Form').form({
			url : '${ctx}/file/add',
			onSubmit : function() {

				parent.$.messager.progress({
					title : '提示',
					text : '数据处理中，请稍后....'
				});
				var isValid = $(this).form('validate');
				if (!isValid) {
					parent.$.messager.progress('close');
				}
				return isValid;
			},
			success : function(result) {
				parent.$.messager.progress('close');
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				} else {
					parent.$.messager.alert('错误', result.msg, 'error');
				}
                $.messager.show({
                    title:'提示',
                    msg:result.msg
                });
			}
		});
//    案例图片上传结束
</script>
<div class="easyui-layout" data-options="fit:true,border:false,height:1000px;">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
		<form id="fileadd_Form" method="post">
			<table class="table">
				<tr>
					<th>文属：</th>
					<td><input type="text" id="numberpart_1" name="numberpart_1" class="easyui-validatebox" data-options="required:true,missingMessage:'文属不能为空！'" style="width:200px;height:30px;"/></td>
					<th>年号：</th>
					<td><input type="text" id="numberpart_2" name="numberpart_2" class="easyui-validatebox" data-options="required:true,missingMessage:'文属不能为空！'" style="width:200px;height:30px;"/></td>
					<th>编号：</th>
					<td><input type="text" id="numberpart_3" name="numberpart_3" class="easyui-validatebox" data-options="required:true,missingMessage:'文属不能为空！'" style="width:200px;height:30px;"/></td>
				</tr>
				<tr>
					<th>题名：</th>
					<td><input type="text" id="name" name="name" class="easyui-validatebox" data-options="required:true,missingMessage:'题名不能为空！'" style="width:200px;height:30px;"/></td>
				</tr>
				<tr>
					<th>页数：</th>
					<td>
						<input type="text" id="pagenumber" name="pagenumber" class="easyui-validatebox"  style="width:200px;height:30px;"/>
					</td>
				</tr>
				<tr>
					<th>份数：</th>
					<td>
						<input type="text" id="copies" name="copies" class="easyui-validatebox" data-options="required:true,missingMessage:'份数不能为空！'" style="width:200px;height:30px;"/>
					</td>
				</tr>
				<tr>
					<th>密级：</th>
					<td>
						<input type="text" name="levels"  id="levelscombo" data-options="required:true,missingMessage:'密级不能为空！'" />
					</td>
				</tr>
				<tr>
					<th>审阅人：</th>
					<td>
						<input type="text" id="reader" name="reader" class="easyui-validatebox"  style="width:200px;height:30px;"/>
					</td>
				</tr>
			</table>
	</form>
	</div>
</div>